package cn.cjxy.demo.service;

import cn.cjxy.demo.domain.User;
import cn.cjxy.demo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public User findByUsername(String username) {
        User user=userMapper.findByUsername(username);
        return user;
    }

    public List<User> findAll(String username,String address) {
        return userMapper.findAll(username,address);
    }

    public User findById(Integer id) {
        return userMapper.findById(id);
    }

    public void update(User user) {
         userMapper.update(user);
    }
}
